Typically, when data is transferred from one computer to another over a TCP/IP (Transfer Control Protocol/Internet Protocol) network, the application program data is first copied from application program memory space to a network buffer in kernel memory space. Application memory and kernel memory are separate memory spaces and are also referred to as protection domains as they protect the data in one domain from interference by programs in other domains. Once the data has been copied into kernel memory, the sockets and networking stack (TCP/IP stack) in the kernel are used to pass the data over the network. In a typical TCP/IP implementation many CPU (Central Processing Unit) cycles are consumed copying data across protection domains as outlined by David Clark et al in Analysis of TCP Processing Overhead, IEEE Communications Magazine, June 1989, Volume 27, Number 6.
One approach to reducing the burden on the CPU in copying data across domains is the use of zero copy techniques. Such techniques avoid the need for copying between protection domains, instead enabling data to be supplied directly to the network stack for transmission to its destination over the network. Zero copy implementations can provide significant increase in performance in terms of data throughput and CPU utilisation. There are two types of approaches to achieve zero copy implementation in a network stack as outlined by H K Jerry Chuin in Zero-Copy TCP in Solaris™, Proceedings of the USENIX, 1996 Annual Technical Conference, San Diego, Calif., January 1996. The first approach is based on shared buffer semantics and second approach is based on virtual copy semantics. Though shared buffer approaches may provide good solutions, they generally call for significant application program source code changes. Virtual copy approaches do not require such code changes. Generally on the send or transmit stage, zero copy is implemented using virtual memory (VM) support. One such method referred to as page remapping with Copy On Write (COW) is used by the Solaris™ operating system as outlined in Zero-Copy TCP in Solaris™ noted above. U.S. Pat. No. 5,182,805 discusses a COW mechanism.
In this zero copy approach, in order to avoid copying data from application program memory space into kernel (operating system) memory space, the application program memory address is remapped into the kernel memory space. In other words, the application memory space becomes a virtual part of the kernel memory space. However, if the application program attempts to change the contents of the remapped memory while it is being used by the kernel, a fault is generated which is referred to as a COW fault. The result of a COW fault is that the original application data is copied from the remapped memory space into kernel memory. As a result, a zero copy operation which generates a COW fault is more costly than the simple application to kernel copy. Some of applications are particularly susceptible to COW faults as outlined by Peter Druschel and Larry L. Peterson in Fbufs: A High-Bandwidth Cross-Domain Transfer Facility, Proceedings of the Fourteenth ACM Symposium on Operating Systems Principles, December 1993. Susceptibility to COW faults is dependent on various factors such as link speed, type of connection (TCP/UDP), round trip delay, and application behaviour.
It is an object of the present invention to provide a method or apparatus for managing data transfer in a computer memory, which reduces the overhead of dealing with COW faults.
It is an object of the present invention to provide a method or apparatus for managing data transfer in a computer memory, which avoids some of the above disadvantages or at least provides the public with a useful choice.